package bjtuoj;

import java.util.Arrays;
import java.util.Scanner;

/**
 * ClassName: Homework_2_E
 * Description:
 * date: 2021-10-16 9:11
 *
 * @author liyifan
 */
public class Homework_2_E {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int n = scanner.nextInt();
            Point[] points = new Point[n + 1];
            for (int i = 1; i <= n; i++) {
                points[i] = new Point();
                points[i].x = scanner.nextInt();
                points[i].y = scanner.nextInt();
            }
            Arrays.sort(points, 1, n);
            int max = Math.min(n, 50);
            double min = Double.MAX_VALUE;
            for (int i = 1; i <= n; i++) {
                for (int j = i + 1; j <= i + 1 + max && j <= n; j++) {
                    if (i == j)
                        continue;
                    if (dist(points[i], points[j]) < min)
                        min = dist(points[i], points[j]);
                }
            }
            System.out.printf("%.2f\n", min);
        }
    }

    public static double dist(Point p1, Point p2) {
        return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
    }
}

class Point implements Comparable {
    public int x;
    public int y;

    public Point(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public Point(){}

    @Override
    public String toString() {
        return "Point{" +
                "x=" + x +
                ", y=" + y +
                '}';
    }

    @Override
    public int compareTo(Object o) {
        Point tmp = (Point) o;
        if (tmp.x != this.x) {
            return this.x - tmp.x;
        } else {
            return this.y - tmp.y;
        }
    }
}